// 防抖
let timeout: any;

export default function debounce(func: () => void, wait: number) {
  return () => {
    if (timeout) {
      clearTimeout(timeout);
    }
    timeout = setTimeout(() => {
      func();
    }, wait);
  };
}
